export class I18nManager {
    constructor() {
        this.translations = {
            zh: {
                validating: "\u6b63\u5728\u9a8c\u8bc1...",
                saveSuccess: "\u4fdd\u5b58\u6210\u529f",
                apiKeyInvalid: "API Key \u65e0\u6548",
                noBalance: "\u6682\u65e0\u4f59\u989d",
                noApiKey: "\u8bf7\u5148\u8bbe\u7f6e API Key",
                fetchError: "\u83b7\u53d6\u5931\u8d25",
                rememberWindowSize: "\u4fdd\u5b58\u7a97\u53e3\u5927\u5c0f"
            },
            en: {
                validating: "Validating...",
                saveSuccess: "Saved successfully",
                apiKeyInvalid: "Invalid API Key",
                noBalance: "No balance",
                noApiKey: "Please set API Key first",
                fetchError: "Failed to fetch",
                rememberWindowSize: "Save window size"
            }
        }
    }
    getCurrentLang() {
        return localStorage.getItem("preferredLang") || "en"
    }
    setCurrentLang(e) {
        localStorage.setItem("preferredLang", e)
    }
    getTranslation(e) {
        const a = this.getCurrentLang();
        return this.translations[a][e] || e
    }
}